{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "       user  item  rating  timestamp\n",
      "0         1     1       5  874965758\n",
      "1         1     2       3  876893171\n",
      "2         1     3       4  878542960\n",
      "3         1     4       3  876893119\n",
      "4         1     5       3  889751712\n",
      "5         1     6       5  887431973\n",
      "6         1     7       4  875071561\n",
      "7         1     8       1  875072484\n",
      "8         1     9       5  878543541\n",
      "9         1    10       3  875693118\n",
      "10        1    11       2  875072262\n",
      "11        1    12       5  878542960\n",
      "12        1    13       5  875071805\n",
      "13        1    14       5  874965706\n",
      "14        1    15       5  875071608\n",
      "15        1    16       5  878543541\n",
      "16        1    17       3  875073198\n",
      "17        1    18       4  887432020\n",
      "18        1    19       5  875071515\n",
      "19        1    21       1  878542772\n",
      "20        1    22       4  875072404\n",
      "21        1    23       4  875072895\n",
      "22        1    24       3  875071713\n",
      "23        1    25       4  875071805\n",
      "24        1    26       3  875072442\n",
      "25        1    27       2  876892946\n",
      "26        1    28       4  875072173\n",
      "27        1    29       1  878542869\n",
      "28        1    30       3  878542515\n",
      "29        1    31       3  875072144\n",
      "...     ...   ...     ...        ...\n",
      "90540   943   685       4  875502042\n",
      "90541   943   717       4  875502116\n",
      "90542   943   720       1  888640048\n",
      "90543   943   721       5  888639660\n",
      "90544   943   722       3  888640208\n",
      "90545   943   724       1  888639478\n",
      "90546   943   732       4  888639789\n",
      "90547   943   739       4  888639929\n",
      "90548   943   756       2  875502146\n",
      "90549   943   763       4  875501813\n",
      "90550   943   765       3  888640227\n",
      "90551   943   785       2  888640088\n",
      "90552   943   794       3  888640143\n",
      "90553   943   796       3  888640311\n",
      "90554   943   816       4  888640186\n",
      "90555   943   824       4  875502483\n",
      "90556   943   825       3  875502283\n",
      "90557   943   831       2  875502283\n",
      "90558   943   840       4  888693104\n",
      "90559   943   928       5  875502074\n",
      "90560   943   941       1  888639725\n",
      "90561   943   943       5  888639614\n",
      "90562   943  1011       2  875502560\n",
      "90563   943  1028       2  875502096\n",
      "90564   943  1044       3  888639903\n",
      "90565   943  1047       2  875502146\n",
      "90566   943  1074       4  888640250\n",
      "90567   943  1188       3  888640250\n",
      "90568   943  1228       3  888640275\n",
      "90569   943  1330       3  888692465\n",
      "\n",
      "[90570 rows x 4 columns]\n"
     ]
    }
   ],
   "source": [
    "# _*_ coding: UTF-8 _*_\n",
    "\n",
    "from itertools import count\n",
    "from collections import defaultdict\n",
    "from scipy.sparse import csr\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from sklearn.feature_extraction import DictVectorizer\n",
    "# import tensorflow as tf\n",
    "from tqdm import tqdm_notebook as tqdm\n",
    "\n",
    "\n",
    "import tensorflow.compat.v1 as tf\n",
    "tf.compat.v1.disable_eager_execution()\n",
    "\n",
    "def vectorize_dic(dic, ix=None, p=None, n=0, g=0):\n",
    "    \"\"\"\n",
    "    dic -- dictionary of feature lists. Keys are the name of features\n",
    "    ix -- index generator (default None)\n",
    "    p -- dimension of feature space (number of columns in the sparse matrix) (default None)\n",
    "    \"\"\"\n",
    "    if ix == None:\n",
    "        ix = dict()\n",
    "\n",
    "    nz = n * g\n",
    "\n",
    "    col_ix = np.empty(nz, dtype=int)\n",
    "\n",
    "    i = 0\n",
    "    for k, lis in dic.items():\n",
    "        for t in range(len(lis)):\n",
    "            ix[str(lis[t]) + str(k)] = ix.get(str(lis[t]) + str(k), 0) + 1\n",
    "            col_ix[i + t * g] = ix[str(lis[t]) + str(k)]\n",
    "        i += 1\n",
    "\n",
    "    row_ix = np.repeat(np.arange(0, n), g)\n",
    "    data = np.ones(nz)\n",
    "    if p == None:\n",
    "        p = len(ix)\n",
    "\n",
    "    ixx = np.where(col_ix < p)\n",
    "    return csr.csr_matrix((data[ixx], (row_ix[ixx], col_ix[ixx])), shape=(n, p)), ix\n",
    "\n",
    "\n",
    "def batcher(X_, y_=None, batch_size=-1):\n",
    "    n_samples = X_.shape[0]\n",
    "\n",
    "    if batch_size == -1:\n",
    "        batch_size = n_samples\n",
    "    if batch_size < 1:\n",
    "        raise ValueError('Parameter batch_size={} is unsupported'.format(batch_size))\n",
    "\n",
    "    for i in range(0, n_samples, batch_size):\n",
    "        upper_bound = min(i + batch_size, n_samples)\n",
    "        ret_x = X_[i:upper_bound]\n",
    "        ret_y = None\n",
    "        if y_ is not None:\n",
    "            ret_y = y_[i:i + batch_size]\n",
    "            yield (ret_x, ret_y)\n",
    "\n",
    "\n",
    "cols = ['user', 'item', 'rating', 'timestamp']\n",
    "\n",
    "train = pd.read_csv('data/ua.base', delimiter='\\t', names=cols)\n",
    "test = pd.read_csv('data/ua.test', delimiter='\\t', names=cols)\n",
    "\n",
    "print(train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  (0, 1)\t2.0\n",
      "  (1, 1)\t1.0\n",
      "  (1, 2)\t1.0\n",
      "  (2, 1)\t1.0\n",
      "  (2, 3)\t1.0\n",
      "  (3, 1)\t1.0\n",
      "  (3, 4)\t1.0\n",
      "  (4, 1)\t1.0\n",
      "  (4, 5)\t1.0\n",
      "  (5, 1)\t1.0\n",
      "  (5, 6)\t1.0\n",
      "  (6, 1)\t1.0\n",
      "  (6, 7)\t1.0\n",
      "  (7, 1)\t1.0\n",
      "  (7, 8)\t1.0\n",
      "  (8, 1)\t1.0\n",
      "  (8, 9)\t1.0\n",
      "  (9, 1)\t1.0\n",
      "  (9, 10)\t1.0\n",
      "  (10, 1)\t1.0\n",
      "  (10, 11)\t1.0\n",
      "  (11, 1)\t1.0\n",
      "  (11, 12)\t1.0\n",
      "  (12, 1)\t1.0\n",
      "  (12, 13)\t1.0\n",
      "  :\t:\n",
      "  (90557, 146)\t1.0\n",
      "  (90558, 51)\t1.0\n",
      "  (90558, 147)\t1.0\n",
      "  (90559, 96)\t1.0\n",
      "  (90559, 148)\t1.0\n",
      "  (90560, 44)\t1.0\n",
      "  (90560, 149)\t1.0\n",
      "  (90561, 38)\t1.0\n",
      "  (90561, 150)\t1.0\n",
      "  (90562, 90)\t1.0\n",
      "  (90562, 151)\t1.0\n",
      "  (90563, 133)\t1.0\n",
      "  (90563, 152)\t1.0\n",
      "  (90564, 38)\t1.0\n",
      "  (90564, 153)\t1.0\n",
      "  (90565, 115)\t1.0\n",
      "  (90565, 154)\t1.0\n",
      "  (90566, 71)\t1.0\n",
      "  (90566, 155)\t1.0\n",
      "  (90567, 41)\t1.0\n",
      "  (90567, 156)\t1.0\n",
      "  (90568, 46)\t1.0\n",
      "  (90568, 157)\t1.0\n",
      "  (90569, 4)\t1.0\n",
      "  (90569, 158)\t1.0\n"
     ]
    }
   ],
   "source": [
    "x_train, ix = vectorize_dic({'users': train['user'].values,\n",
    "                             'items': train['item'].values}, n=len(train.index), g=2)\n",
    "\n",
    "print(x_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# print(ix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "x_test, ix = vectorize_dic({'users': test['user'].values,\n",
    "                            'items': test['item'].values}, ix, x_train.shape[1], n=len(test.index), g=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "y_train = train['rating'].values\n",
    "y_test = test['rating'].values\n",
    "\n",
    "x_train = x_train.todense()\n",
    "x_test = x_test.todense()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0. 2. 0. ... 0. 0. 0.]\n",
      " [0. 1. 1. ... 0. 0. 0.]\n",
      " [0. 1. 0. ... 0. 0. 0.]\n",
      " ...\n",
      " [0. 0. 0. ... 0. 0. 0.]\n",
      " [0. 0. 0. ... 0. 0. 0.]\n",
      " [0. 0. 0. ... 0. 0. 0.]]\n"
     ]
    }
   ],
   "source": [
    "print(x_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[5 3 4 ... 3 3 3]\n",
      "(90570,)\n"
     ]
    }
   ],
   "source": [
    "print(y_train)\n",
    "print(y_train.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x_train.shape:  (90570, 2623) x_test.shape:  (9430, 2623)\n"
     ]
    }
   ],
   "source": [
    "print(\"x_train.shape: \", x_train.shape, \"x_test.shape: \", x_test.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "n, p = x_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "变量n: 90570 变量p: 2623\n"
     ]
    }
   ],
   "source": [
    "print(\"变量n:\", n, \"变量p:\", p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "# k维特征向量。隐藏因子 10，建议为2的幂。\n",
    "# k越大，即对特征分量的表现能力越强，高阶参数间独立性越强，模型越精细；\n",
    "# k越小，泛化能力越强。\n",
    "k = 10\n",
    "\n",
    "x = tf.placeholder('float', [None, p])\n",
    "\n",
    "y = tf.placeholder('float', [None, 1])\n",
    "\n",
    "w0 = tf.Variable(tf.zeros([1]))\n",
    "w = tf.Variable(tf.zeros([p]))\n",
    "\n",
    "v = tf.Variable(tf.random_normal([k, p], mean=0, stddev=0.01))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<tf.Variable 'Variable_6:0' shape=(1,) dtype=float32>\n",
      "<tf.Variable 'Variable_7:0' shape=(2623,) dtype=float32>\n",
      "<tf.Variable 'Variable_8:0' shape=(10, 2623) dtype=float32>\n"
     ]
    }
   ],
   "source": [
    "print(w0)\n",
    "print(w)\n",
    "print(v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "49d69b5d830941d8aec34fd73d1da05c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/html": [
       "<p>Failed to display Jupyter Widget of type <code>HBox</code>.</p>\n",
       "<p>\n",
       "  If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
       "  that the widgets JavaScript is still loading. If this message persists, it\n",
       "  likely means that the widgets JavaScript library is either not installed or\n",
       "  not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
       "  Widgets Documentation</a> for setup instructions.\n",
       "</p>\n",
       "<p>\n",
       "  If you're reading this message in another frontend (for example, a static\n",
       "  rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
       "  it may mean that your frontend doesn't currently support widgets.\n",
       "</p>\n"
      ],
      "text/plain": [
       "HBox(children=(IntProgress(value=0, max=10), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 0 perm: [85013 83686  3555 ... 81464 19261 35049] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 13.619878\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 13.181178\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 13.023294\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 12.521459\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 11.928841\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 11.136741\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 10.884273\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 10.469571\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 10.052216\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 10.127236\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 9.739701\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 9.050704\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 8.967777\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 8.262244\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 8.059703\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 8.031648\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 7.7270813\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 7.699461\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 7.1500735\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 6.3661017\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 6.58302\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 6.727567\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 6.3199787\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 6.0691333\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 6.162967\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 5.9177628\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 5.334089\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 5.2728744\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.9836307\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.93447\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.8897758\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.7119975\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.5943017\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.451562\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.4560637\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.165489\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 4.0682993\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.924275\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.8020012\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.7031596\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.8336499\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.4215674\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.5034082\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.4083416\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.2583349\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.3143458\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.10333\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.9794078\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 3.0420978\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.8268373\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.7074232\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.7938092\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.7924907\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.6002524\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.471667\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.5236726\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.6090357\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.3458753\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.3697658\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.291194\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.3173258\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.1970305\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.3007214\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.1502292\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.119578\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.2042525\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.9948299\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.0405984\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.1372817\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.9134626\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.9449579\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.9945451\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.9102521\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.793576\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 2.0025172\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.759356\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.7836163\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.7324874\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.7030671\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.8105354\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.7101531\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.7015468\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.8142632\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.6526072\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.6596785\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.6747555\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.5597607\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.6576834\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.6529169\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.6737564\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.6104726\n",
      "epoch: 1 perm: [74617 80146 28725 ... 84495 74600 15413] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.6390378\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.5907648\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.5263801\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.5297685\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.5454668\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.405664\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.5300463\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.5357639\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4948305\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.41034\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.554437\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4312602\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3928329\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4075845\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4640384\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3681165\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4827559\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3733453\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4892675\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3932346\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3985994\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3306488\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3990142\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.372814\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3940752\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3095216\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3783208\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.40885\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3630128\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3489275\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3306602\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3675325\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3310891\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3482926\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4059776\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2735801\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3782386\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3816034\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4042842\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3574005\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3490243\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3913969\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2962372\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2955498\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3440493\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.37813\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3228998\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3245747\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3321247\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3363297\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3040745\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3395894\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3073201\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2987032\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3632401\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "t: 1.2484212\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3868325\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1940967\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2990444\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2226969\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3398275\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.313884\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2685266\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3097161\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2109333\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3677893\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3122221\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2595078\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2500559\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1797516\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3141066\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3284434\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2773417\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2318335\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2334313\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.258311\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2362765\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2420137\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.42697\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3026327\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2440872\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2239956\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3087575\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3418255\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3633193\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3032038\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2700187\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2423934\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2131745\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3001516\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.2513475\n",
      "epoch: 2 perm: [62456 57665  4631 ... 57715 73980 50720] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1953132\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3190209\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3097917\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3396534\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3283148\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3612831\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2803004\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1960819\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2931781\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3523284\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2131399\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1937475\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4119313\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2279621\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2517635\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2230234\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3235044\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2438463\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2674068\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2806486\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2721901\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3362141\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2651689\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.33835\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.322294\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3515657\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2356175\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2732284\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2310212\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3207527\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3212545\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3437492\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3457068\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2541645\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2980907\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1895999\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2540061\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2568208\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2976813\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3251275\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.212702\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3652492\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2772408\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.331654\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2567159\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3158326\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2557684\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2836937\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1199296\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.23987\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2072728\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1982079\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2128358\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2425293\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2346938\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3210309\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.386797\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2492408\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2870129\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.343217\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2600999\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2483131\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.260289\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3215142\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2895864\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3006566\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1973325\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2515335\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2658314\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2766608\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2692081\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3157367\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2432476\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3066167\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2233864\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2637231\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2704078\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2958343\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2467321\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2940412\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2225796\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3132533\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2431762\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2633586\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3167652\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1408105\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2169558\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2983714\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3210553\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2903253\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.2428991\n",
      "epoch: 3 perm: [61701 20251 28767 ... 62025  5729 52831] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1983565\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2362419\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2053183\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2573998\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2402127\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3209099\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2578588\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3706864\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2197633\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2307451\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3581347\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3181468\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2833844\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2084432\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3034723\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4085126\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2485372\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2423564\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2050422\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2367895\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3787955\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2657689\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3193529\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2619853\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2597505\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2560138\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3436254\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2686691\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1681908\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3164068\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.314011\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3283876\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2289016\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2724315\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2881039\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2267632\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2907851\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2244861\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3643674\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2229618\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3548036\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3269389\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2583618\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2072833\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2676471\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2547885\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2021368\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2476866\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3187652\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3196923\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.298966\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3084186\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3626271\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3196813\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1833341\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3073262\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2682459\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2907306\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3200513\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2067945\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2636465\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2941246\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2350198\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2845938\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2606813\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3121414\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3197393\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2835758\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.217373\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.236745\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2630949\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3559045\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2778282\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2304058\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2250638\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2626675\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2307568\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1359293\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2605743\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.282068\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1271237\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2879915\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3184301\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2731285\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4000176\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2484776\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4077798\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1828457\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2126449\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2901472\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.3228244\n",
      "epoch: 4 perm: [37254 60121 37269 ... 50026 81337 38997] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3327603\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3016587\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2507102\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.296953\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1956697\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2504039\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2404104\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2773367\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2645187\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3153685\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1634918\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2711946\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3064725\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2072712\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2706616\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2675492\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2043035\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.221472\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.184243\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.302456\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1779504\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2410927\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2716323\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2106493\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2206116\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2919778\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2023661\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2469648\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2426108\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2049154\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2658169\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3045403\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2860303\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3295383\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2278854\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2328597\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3431153\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3057337\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3680116\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2291086\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3710455\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1399603\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2769871\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.286622\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3266462\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2979277\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2888443\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3172067\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2115684\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.37063\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2967365\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3440297\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2482371\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.308884\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2356038\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.302323\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2670964\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2632139\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.277572\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3654157\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2628367\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.334794\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2712003\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2805418\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2170514\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3279454\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3265918\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.324183\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3458433\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.207539\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2775912\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3169026\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2280868\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2053937\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3338113\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2623032\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "t: 1.2983725\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.295525\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2994915\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1678406\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2675185\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2981057\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2549466\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.320269\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2282157\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2316045\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3220307\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2987677\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2877376\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3126663\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.2493603\n",
      "epoch: 5 perm: [38588 10982 74081 ... 80735 10569 30281] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2520773\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2093242\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2340866\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3452934\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2720579\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3846697\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2326505\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.326068\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.248084\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2622072\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2609974\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1447701\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2744842\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3299915\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2762879\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2168823\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2069046\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3015585\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2364337\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3040975\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1795621\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2578884\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2692631\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2523737\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2236342\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2729027\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3409191\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2462822\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2782801\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2938998\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2517494\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2839779\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2832199\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2481225\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3764244\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2794044\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3507106\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2646904\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2306494\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2453105\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.266311\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2278422\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2339542\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.282435\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.329628\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2793173\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2880324\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3188622\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1393023\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2899493\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3294499\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3124686\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3081559\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1991926\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2782515\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2003288\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2796897\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3313997\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.339374\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2463992\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3018482\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.310003\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2857288\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3326985\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3351678\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2871639\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2306415\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1915001\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2016531\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2495424\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2826163\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2666535\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3110318\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2611713\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3147632\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2886722\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2800797\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2141181\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3121343\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.236027\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2680577\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2707778\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1763066\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3085701\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2322154\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2609127\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2287961\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2820035\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3160821\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3364906\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.3755296\n",
      "epoch: 6 perm: [89170 29918  2059 ... 14724 48475 45531] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.206028\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2010185\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2570547\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2549561\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2821319\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3199164\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.239939\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2526248\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2850552\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2834179\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2810711\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1826618\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1604673\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2360014\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2410728\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.268031\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3255471\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2690521\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2820532\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3253508\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1612564\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3400174\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2633073\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2919134\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2707689\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2051605\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2485745\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3235775\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2453576\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2469205\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2990916\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2674447\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3347931\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3724425\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2272453\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3384168\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2227492\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2241042\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2939954\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3101201\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1721498\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2910913\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2944512\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2754834\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2792273\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3178006\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3266132\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2903008\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3058124\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2535928\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3322225\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2383494\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2744347\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3539513\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2239116\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3248914\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2573603\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2683922\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2798464\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2768341\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1693683\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2218006\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2506722\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2411219\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2475092\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2612547\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2997079\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2837129\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2661192\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1735411\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2983987\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1836411\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2527494\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2769243\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3094989\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2768786\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2844043\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.301475\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2400525\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2911252\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3502922\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2906947\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3322624\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3146807\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2491219\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2859099\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3345658\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3758931\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2386658\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2378939\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.2587028\n",
      "epoch: 7 perm: [73847 61982 32375 ... 76232 79533 25030] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2832297\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2710652\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2289925\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2785612\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2445453\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2247359\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2166244\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2491285\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3136235\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2111504\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2859441\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2099605\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2215891\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2477534\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2490417\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2786105\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2344153\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2150508\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3032672\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3049242\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3439586\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2557071\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.307592\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2241892\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3035151\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2839246\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.169897\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2783225\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2818809\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3016679\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1955811\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2982739\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2679311\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3837404\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.289446\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2289214\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2975667\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.401848\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2929405\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2195228\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2545778\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2631072\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.352324\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3199263\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2564296\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.25008\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3286865\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2507694\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3483121\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.393579\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2296481\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2009755\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2871952\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2793552\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3005\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3342712\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2274412\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2623196\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2445222\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.237731\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2865806\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2222097\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1788098\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2580897\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.298374\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3004861\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2132535\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1915227\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2737302\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3013304\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.293908\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2865539\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2880777\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.4001466\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2330971\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2280172\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2479168\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3325515\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3461981\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3715692\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2753283\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1997262\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2214977\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3491853\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2445377\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1542298\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.298012\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2205988\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2398742\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2878041\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.2686443\n",
      "epoch: 8 perm: [69311  3078 49410 ... 82533 61477 54745] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2433252\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3062521\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1703328\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3435155\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2673695\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3462756\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2797669\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2433647\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2771363\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2556404\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2632917\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2532053\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3132716\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2211865\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.169127\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2959926\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.224038\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2849025\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1836126\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.285599\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2999562\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.323769\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2137785\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3519193\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2047104\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2466561\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2499118\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2603022\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2595223\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2993454\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2610842\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2084914\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2660834\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2270982\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2215852\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3099089\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1646502\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3197353\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2422347\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.233717\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3476714\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2547194\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2901771\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2525519\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3004196\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2570071\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3185781\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3245336\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2322637\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2937877\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2083243\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2435727\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2339127\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3859066\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3492738\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2609317\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2992275\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2970312\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.260463\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2536852\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3014114\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2714082\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2350441\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1573626\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3539801\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3075906\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2213765\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2913914\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3536224\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3298234\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3017542\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1931602\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2423348\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3139435\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2606908\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2874306\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.310658\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1967733\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2208424\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3604091\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2781516\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2684159\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2685411\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.23258\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3117417\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2712467\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2463372\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2357893\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2351916\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3146884\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.4284382\n",
      "epoch: 9 perm: [70530 77435 48101 ... 47295   550 39584] len( perm): 90570\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2466917\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2285018\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2841811\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2429585\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2888639\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3119972\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2191927\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.231857\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3359447\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2438453\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.250936\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2239556\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3038785\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2260284\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2510618\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2761605\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2915183\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3279319\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3016919\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2821424\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3177496\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3120346\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2799268\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2773333\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2845448\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2309138\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.248866\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2208749\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2445738\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2305486\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2895161\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2754816\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2143966\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2585795\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2252218\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2604814\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3582947\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2513465\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1729205\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2637748\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2735356\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2892413\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3236351\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2493404\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2765745\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3025744\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2836667\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3385117\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2825342\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2198856\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1961912\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2174225\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2103899\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3613342\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2780902\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3051121\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2916889\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2904341\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2627922\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3049685\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.264301\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "t: 1.2539225\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3660367\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2669032\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3223003\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1519591\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3110824\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2907059\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.1995894\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2390739\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.236883\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2716467\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3016834\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2820426\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3331634\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2884011\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2700855\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2394319\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2666228\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.205612\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2559997\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2252128\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3435766\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3190852\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2486986\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.24488\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2420714\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.3262777\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.326264\n",
      "bX.shape: (1000, 2623)  bY.shape: (1000,)\n",
      "t: 1.2345768\n",
      "bX.shape: (570, 2623)  bY.shape: (570,)\n",
      "t: 1.2878438\n",
      "\n",
      "=======================================\n",
      "errors: [1.2659429]\n",
      "=======================================\n",
      "1.1251413\n"
     ]
    }
   ],
   "source": [
    "# y_hat = tf.Variable(tf.zeros([n,1]))\n",
    "# 线性\n",
    "linear_terms = tf.add(w0, tf.reduce_sum(tf.multiply(w, x), 1, keep_dims=True))  # n * 1\n",
    "# dnn\n",
    "pair_interactions = 0.5 * tf.reduce_sum(\n",
    "    tf.subtract(\n",
    "        tf.pow( tf.matmul(x, tf.transpose(v)), 2),\n",
    "        tf.matmul(tf.pow(x, 2), tf.transpose(tf.pow(v, 2)))\n",
    "    ), axis=1, keep_dims=True)\n",
    "\n",
    "y_hat = tf.add(linear_terms, pair_interactions)\n",
    "\n",
    "lambda_w = tf.constant(0.001, name='lambda_w')\n",
    "lambda_v = tf.constant(0.001, name='lambda_v')\n",
    "\n",
    "# 正则\n",
    "l2_norm = tf.reduce_sum(\n",
    "    tf.add(\n",
    "        tf.multiply(lambda_w, tf.pow(w, 2)),\n",
    "        tf.multiply(lambda_v, tf.pow(v, 2))\n",
    "    )\n",
    ")\n",
    "\n",
    "# 这里我们定义的损失函数除了平方损失外，还加了l2正则项，并使用梯度下降法进行参数的更新：\n",
    "error = tf.reduce_mean(tf.square(y - y_hat))\n",
    "loss = tf.add(error, l2_norm)\n",
    "\n",
    "train_op = tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(loss)\n",
    "\n",
    "epochs = 10\n",
    "batch_size = 1000\n",
    "\n",
    "# Launch the graph\n",
    "init = tf.global_variables_initializer()\n",
    "with tf.Session() as sess:\n",
    "    sess.run(init)    \n",
    "    \n",
    "    # 遍历1000*10次\n",
    "    for epoch in tqdm(range(epochs), unit='epoch'):\n",
    "        perm = np.random.permutation(x_train.shape[0])\n",
    "              \n",
    "        print(\"epoch:\", epoch, \"perm:\", perm, \"len( perm):\", len( perm))\n",
    "        \n",
    "        # iterate over batches\n",
    "        for bX, bY in batcher(x_train[perm], y_train[perm], batch_size):\n",
    "           \n",
    "            # print(bX)      \n",
    "            # print(bY)\n",
    "            print(\"bX.shape:\", bX.shape, \" bY.shape:\", bY.shape)     \n",
    "            \n",
    "            # 1000x2623, bX.reshape(-1, p), -1为 2623      1000行2623列\n",
    "            # 1x1000   bY.reshape(-1, 1),  -1为1000        1000行1列\n",
    "           \n",
    "            _, t = sess.run([train_op, loss], feed_dict={x: bX.reshape(-1, p), y: bY.reshape(-1, 1)})\n",
    "            print(\"t:\",t)\n",
    "\n",
    "    print(\"=======================================\")\n",
    "    errors = []\n",
    "    for bX, bY in batcher(x_test, y_test):\n",
    "        errors.append(sess.run(error, feed_dict={x: bX.reshape(-1, p), y: bY.reshape(-1, 1)}))\n",
    "        print(\"errors:\",errors)\n",
    "    RMSE = np.sqrt(np.array(errors).mean())\n",
    "    print(\"=======================================\")\n",
    "    print(RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
